﻿open Xunit
open FSharpChess
[<Fact>]
let test_nocheck() =
    Psn_tests.setup_pos3()
    Funcs.gm.SetMaterialCount()
    let mv = Funcs.gm.CreateMove(Standard, 2, 13, 6, 16, 0)
    let cond = not (Move_check.move_is_check mv Funcs.gm)
    Assert.True(cond,"This should not be check")
[<Fact>]
let test_check_B() =
    Psn_tests.setup_pos13()
    Funcs.gm.SetMaterialCount()
    let mv = Funcs.gm.CreateMove(Standard, 2, 51, 42, -1, 0)
    let cond = Move_check.move_is_check mv Funcs.gm
    Assert.True(cond,"This should be check")
[<Fact>]
let test_check_R() =
    Psn_tests.setup_pos14()
    Funcs.gm.SetMaterialCount()
    let mv = Funcs.gm.CreateMove(Standard, 0, 51, 59, -1, 0)
    let cond = Move_check.move_is_check mv Funcs.gm
    Assert.True(cond,"This should be check")
[<Fact>]
let test_check_N() =
    Psn_tests.setup_pos15()
    Funcs.gm.SetMaterialCount()
    let mv = Funcs.gm.CreateMove(Standard, 1, 58, 41, -1, 0)
    let cond = Move_check.move_is_check mv Funcs.gm
    Assert.True(cond,"This should be check")
[<Fact>]
let test_check_P() =
    Psn_tests.setup_pos16()
    Funcs.gm.SetMaterialCount()
    let mv = Funcs.gm.CreateMove(Standard, 8, 41, 49, -1, 0)
    let cond = Move_check.move_is_check mv Funcs.gm
    Assert.True(cond,"This should be check")
[<Fact>]
let test_check_disc() =
    Psn_tests.setup_pos17()
    Funcs.gm.SetMaterialCount()
    let mv = Funcs.gm.CreateMove(Standard, 0, 49, 50, -1, 0)
    let cond = Move_check.move_is_check mv Funcs.gm
    Assert.True(cond,"This should be check")
    
        

